<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
            *{
               margin: 0px;
               padding: 0px;
               list-style: none; 
            }
            ul{
                overflow: hidden;
            }
            ul li{
                float: left;
                width:120px;
                text-align: center;
                cursor: pointer;
            }
            p{
                width:100px;
                height: 40px;
                line-height: 40px;
                text-align: center;
                display: none;
            }
            li.a{
                background:#f60;
                color:white;
            }
            p.b{
                display: block
            }
        </style>
</head>
<body>
    <ul>
        <li class="a">话费</li>
        <li>机票</li>
        <li>酒店</li>
    </ul>
    <div>
        <p class="b"><input type="text" placeholder="手机号"><a href=""></a>
            <input type="text" placeholder="充值额度"><a href=""></a>
      <a href="">  <span>确定</span></p></a>
        <p><input type="text" placeholder="出发城市"><a href=""></a>
            <input type="text" placeholder="到达城市"><a href=""></a>
            <input type="text" placeholder="出发日期"><a href=""></a>
        <a href=""><span>机票查询</span></a></p>
        <p><input type="text" placeholder="目的地"><a href=""></a>
            <input type="text" placeholder="入住日期"><a href=""></a>
            <input type="text" placeholder="离店日期"><a href=""></a>
            <a href=""><span>酒店查询</span></a></p>
    </div>
    <script>
        var tags=document.getElementsByTagName('li');
        var cons=document.getElementsByTagName('p');
        for(var i=0;i<tags.length;i++){
            tags[i].zsh=i;
            tags[i].onclick=function(){
                for(var t=0;t<tags.length;t++){
                    tags[t].className='';
                    cons[t].className='';
                }
                this.className="a";
                var n=this.zsh;
                cons[n].className='b'
            }
        }
    </script>
</body>
</html>